<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查看</title>
    <script src="../../res/layui/layui.js"></script>
    <link rel="stylesheet" href="../../res/layui/css/layui.css" type="text/css">
    <script src="../../res/js/Tools.js" charset="utf-8"></script>
    <script src="../../res/js/jquery-3.1.1.min.js" charset="utf-8"></script>
    <style>
        #zuida{
            margin-left: 15%;
        }
        #biaoti {
            margin-top: 20px;
            width: 80%;
            text-align: center;
            font-size: 35px;
        }
        #shijian{
            width: 80%;
            margin-top: 20px;
        }
        #faburen,#chuangjianren{

            width: 80%;
        }
        #neirong{
            margin-top: 15px;

            width: 80%;
        }
        #neirongT{
            margin-top: 15px;
        }
        #file1,#file2,#file3{
            margin-top: 20px;
        }
        #fujian{


            width: 80%;
            height: 100px;
        }


        #ren{
            margin-top: 15px;
        }

        #dier{
            width: 80%;
            margin-left: 10%;
        }
    </style>
</head>
<body>
<div id="zuida">
    <div id="biaoti">
    </div>
    <div id="shijian"><span style="font-weight: 700;">发布日期：</span><span id="riqi"></span></div>
    <div id="ren">
        <div id="chuangjianren"><span style="font-weight: 700;">创建人（单位）：</span><span id="fbr"></span></div>
    </div>
    <div id="neirongT"  style="font-weight: 700;">内容：</div>
    <div id="neirong">

    </div>
    <div>
    <button class="layui-btn layui-icon layui-icon-file" id="file1" lay-event="export"  data-type="reload">查看（下载附件1）</button>
    <button class="layui-btn layui-icon layui-icon-file" id="file2" lay-event="export"  data-type="reload">查看（下载附件2）</button>
    <!--//<div id="file3"><a href="#"  target="_blank" id="a3">查看（下载附件）</a></div>-->
    <button class="layui-btn layui-icon layui-icon-file" id="file3" lay-event="export"  data-type="reload">查看（下载附件3）</button>
</div>
</div>

<div id="dier">

    <table class="layui-hide" id="test" lay-filter="test"></table>
    <script>
        var table2=null;
        var attachId  =getQueryString("attachId");
        var attachTypeTwo="";
        var url="../../AtsAttachmentAction/selectByPrimaryKey";
        var data={attachId:attachId};
        $.post(url,data,function(obj){
            attachTypeTwo =obj.attachType;
            if(attachTypeTwo!='10'){
                layui.use('table', function(){
                    var table = layui.table;
                    table2=  table.render({
                        elem: '#test'
                        ,url:"../../AtsAttachmentEmpAction/selectAudit?saId="+getQueryString("attachId")
                        ,title: '用户数据表'
                        ,cellMinWidth: 200
                        ,cols: [[
                            {field:'creater', title: '审核人', width:80}
                            ,{field:'auExp', title: '审核意见', width:150,}
                            ,{field:'auTime', title: '审核时间', width:120,}
                            ,{field:'auditState', title: '审核状态', width:150, templet:'#zhuangtai'}
                        ]]
                    });
                });
            }
        },"json");
    </script>
    <script type="text/html" id="zhuangtai">
        {{# if(d.auditState==20){ }}
        <div style="color: green"> 已通过</div>
        {{# } else if(d.auditState==21){}}
        <div style="color: red">未通过</div>
        {{# } }}
    </script>

</div>
<script>
    var attachId=getQueryString("attachId");
    $(function(){
        formvaluation();
    })
    function formvaluation(){
        var url="../../AtsAttachmentAction/selectByPrimaryKey?attachId="+attachId;
        $.post(url,null,function(obj){
            $("#biaoti").html(obj.attachName);
            $("#riqi").html(obj.attachTime);
            $("#neirong").html(obj.attachContent);
            $("#fbr").html(obj.attachPublisher);
            if(obj.file1!=null){
                $("#file1").show();
                $("#file1").click(function () {
                    window.open('../..'+obj.file1)
                })
            }else{
                $("#file1").hide();
            }
            if(obj.file2!=null){
                $("#file2").show();
                $("#file2").click(function () {
                    window.open('../..'+obj.file2)
                })
            }else{
                $("#file2").hide();
            }
            if(obj.file3!=null){
                $("#file3").show();
                $("#file3").click(function () {
                    window.open('../..'+obj.file3)
                })
            }else{
                $("#file3").hide();
            }
        })
    }
</script>
</body>
</html>